<template>
    <!--主页面买房管家  找房委托下面的搜素框===ZxFindHouse====ZxHousingManager-->
    <el-row>
        <el-col :span="24"><div class="grid-content bg-purple">
            <el-form :inline="true" v-model="seleceFrom" class="demo-form-inline">
                <el-col :span="7">
                <el-form-item label="会员注册手机">
                    <el-input v-model="seleceFrom.user_iphone" placeholder="请输入会员注册手机"></el-input>
                </el-form-item>
                </el-col>
                <el-col :span="7">
                <el-form-item label="楼盘分析师">
                    <!--问题1：下拉列表里面是将获取的值:value="item.admin_account"
                    v-model="seleceFrom.admin_account"这里是将获取的值赋给给select
                    也就是这两处绑定的是不一样的-->
                    <el-select v-model="seleceFrom.admin_account" placeholder="请选择楼盘分析师">
                        <el-option v-for="item in formInline"
                                   :key="item.admin_account"
                                   :label="item.admin_name"
                                   :value="item.admin_account">
                        </el-option>
                    </el-select>
                </el-form-item>
                </el-col>
                <el-col :span="7">
                <el-form-item label="提交时间">
                    <el-date-picker type="date" placeholder="开始时间" v-model="formInline.user_reg_tiame" style="width: 100%;"></el-date-picker>
                </el-form-item>
                </el-col>
                <el-col :span="3">
                <el-form-item>
                    <el-button @click="onSubmit()" type="primary" plain>查询</el-button>
                </el-form-item>
                </el-col>
            </el-form>
        </div></el-col>
    </el-row>
</template>

<script>
    import * as api from '../utils/api'
    export default {
        name: "ZxHouseSearchInput",
        props:['data'],
        data() {
            return {
                formInline: [
                    {
                        admin_account:'',
                        admin_name: '',
                        user_reg_tiame:'',
                    }
                ],
                seleceFrom:
                    {
                        user_iphone: '',
                        admin_account:'',
                        user_reg_tiame: '',
                    }
            }
        },
        created() {
            this.getFindAdmin()
        },
        methods: {
            /*点击查询之后===给页面重新赋值*/
            onSubmit() {
                console.log(this.seleceFrom);
                this.axios({
                    url:api.GET_FINDHOUSEMANGSEARCH,
                    method:'get',
                    params:{admin_account:this.seleceFrom.admin_account,
                        user_iphone:this.seleceFrom.user_iphone}
            }).then(data=>{
                    /*this.formInline=data.data.dataList*/
                  /*  console.log(data)*/
                }).catch(err=>{

                })
            },
            /*查询所有管理名称接口===已经分配委托===查询所有楼盘分析师*/
            getFindAdmin(){
                this.axios({
                    url:api.GET_FINDADMI,
                }).then(data=>{
                    this.formInline=data.data.data
                       /* console.log(data.data.data)*/
                }).catch(err=>{

                })
            }
        }
    }
</script>

<style scoped>

</style>